﻿using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using ARchGL.Platform.Core;
using ARchGL.Platform.EntityFrameworkCore;

namespace ARchGL.Platform.Mappings
{
    public class SecurityChecksMapping : IEntityTypeConfiguration<SecurityChecks>
    {
        public void Configure(EntityTypeBuilder<SecurityChecks> builder)
        {
            //builder.ToTable(MappingConsts.Prefix + nameof(SecurityChecks));

            builder.Property(p => p.Content).HasMaxLength(500);
            builder.Property(p => p.Result).HasMaxLength(500);
            builder.Property(p => p.ProjectViewPortsArray).HasMaxLength(1000);
            builder.Property(p => p.CorrectContent).HasMaxLength(1000);

            builder.Property(p => p.SecurityChecksPropertysArray).HasMaxLength(1000);
            builder.Property(p => p.NotifyUsersArray).HasMaxLength(1000);
            builder.Property(p => p.CCUsersArray).HasMaxLength(1000); 
        }
    }

    public class SecurityChecksTurnOverHistorysMapping : IEntityTypeConfiguration<SecurityChecksTurnOverHistorys>
    {
        public void Configure(EntityTypeBuilder<SecurityChecksTurnOverHistorys> builder)
        {
            //builder.ToTable(MappingConsts.Prefix + nameof(SecurityChecksTurnOverHistorys));
            builder.Property(p => p.UserArray).HasMaxLength(1000);
        }
    }

    public class SecurityCheckAndFeedbacksMapping : IEntityTypeConfiguration<SecurityCheckAndFeedbacks>
    {
        public void Configure(EntityTypeBuilder<SecurityCheckAndFeedbacks> builder)
        {
            //builder.ToTable(MappingConsts.Prefix + nameof(SecurityCheckAndFeedbacks));

            builder.Property(p => p.NotifyUsersArray).HasMaxLength(1000);
            builder.Property(p => p.CCUsersArray).HasMaxLength(1000);
            builder.Property(p => p.Content).HasMaxLength(500);
        }
    }

    public class SecurityChecksItemMapping : IEntityTypeConfiguration<SecurityCheckItems>
    {
        public void Configure(EntityTypeBuilder<SecurityCheckItems> builder)
        {
            //builder.ToTable(MappingConsts.Prefix + nameof(SecurityCheckItems));

            builder.Property(p => p.Name).HasMaxLength(256);
        }
    }
}
